import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/river/sysregion/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/river/sysregion',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/river/sysregion/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/river/sysregion/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/river/sysregion',
    method: 'put',
    data: obj
  })
}

export function getCascadeData(pid, level, year) {
  return request({
    url: '/river/sysregion/cascade/' + pid,
    method: 'get',
    params: {
      level,
      year
    }
  })
}

export function getSelectList(pid) {
  return request({
    url: '/river/sysregion/select/' + pid,
    method: 'get'
  })
}
